home *** CD-ROM | disk | FTP | other *** search
/ CD Concept 6 / CD Concept 06.iso / mac / UTILITAIRE / Survival 6.0.2 / Macros / TimeMacro 1 < prev   
Text File  |  1995-03-18  |  3KB  |  49 lines

  1. MACRO 'TimeDependent';
  2.  
  3. {this macro assumes that you selected VAR1 as time dependent covariate
  4. and VAR2 as fixed covariate.Notice that rVar[] addresses to data in  
  5. the selected vars array while rData[] addresses to the data in the   
  6. active data array loaded with the Get Data option of the File Menu.  
  7. If the value of the variable in columm 2 of the data matrix is less  
  8. than 650 the selected VAR1 takes the value of zero (0);otherwise its 
  9. value is substracted from the average value for that variable. This  
  10. latter operation should be done for both, time dependent and fixed  
  11. covariate, to avoid internal overflow errors.}
  12. NOTICE that the index in the rVar[] token is the order of selection  
  13. of the variable NOT the column number of that variable in the global 
  14. data array (rData[]).
  15. This macro MUST be inserted in the Macros Menu before performing a
  16. Time Dependent analysis. Otherwise you'll get an error message}
  17.  
  18.  
  19. begin
  20.  
  21. {rVar[1] is selected as time dependent covariate (age at diagnosis)   
  22. survival times are in column 2 of the global data array (rData[2])   
  23. If survival times are equal or greater that 650 days, age takes its
  24. value otherwise is set to zero. This is the general rule to follow  
  25. with time dependent analysis}
  26.  
  27.     FUNCTION
  28.          If rData[2] >= 650 then rVar[1]:= (rVar[1] - rMean[1]) else rVar[1]:= 0;
  29.             rVar[2]:= (rVar[2] - rMean[2]); {Fixed covariate = grade}
  30.   end;
  31. end;
  32.  
  33. {This is the same but with a different approach. Lets suppose you selected
  34. Vars in columns 3,5 and 7 from your database as time dependent covariates
  35. The order they are located in the selected variables array (rVar[])      
  36. are as follows: 1 for Var 3; 2 for Var 5; and 3 for Var 7  
  37.                
  38. FUNCTION    (we invoque the  FUNCTION macro command)                                                                                                                                      Then we start by setting all time dependent variables to zero:            
  39. rVar[1] := 0; rVar[2] := 0; rVar[3]:= 0;                                    
  40. Now we make the following conditional test                                           
  41. if rData[2] >=650 then (is the condition  met at each failure time ?)                                                                   begin                                                                                                                         
  42.      rVar[1]:= rData[3] - rMean[1];                                         
  43.         rVar[2]:= rData[5] - rMean[2];                                         
  44.      rVar[3]:= rData[7] - rMean[3];                                         
  45.     end;                                                                    
  46.  NOTICE that we substract the value of the variable from its average     
  47. value (rMean[]) to avoid owerflow problems.                               
  48. END; (end of FUNCTION macro command)                                    }                                                      
  49. IF YOU UNDERSTAND THIS YOU'RE READY TO PERFORM TIME DEPENDENT ANALYSIS   }